<template>
  <div>
    <a-table :columns="columns" :data-source="data">
      <a slot="name" slot-scope="text">{{ text }}</a>
      <span slot="customTitle">Name</span>
      <span slot="action" slot-scope="text, record">
        <!-- <a>Invite 一 {{ record }} </a> -->
        <a>编辑</a>
        <a style="color: red; margin-left: 16px;"> 删除 </a>
      </span>
    </a-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: [
        {
          key: "1",
          way: "Jim Green",
          age: 42,
          title: "London No. 1 Lake Park",
        },
        {
          key: "3",
          way: "Joe Black",
          time: 32,
          title: "Sidney No. 1 Lake Park",
        },
      ],
      columns: [
        {
          title: "标题",
          dataIndex: "title",
          key: "title",
        },
        {
            title: "模式",
          dataIndex: "way",
          key: "way",
        },
        {
          title: "时间",
          dataIndex: "time",
          key: "time",
        },
        {
          title: "操作",
          key: "action",
          scopedSlots: { customRender: "action" },
        },
      ],
    };
  },
  methods: {
    onSearch(values) {
      console.log(values);
      var reg = new RegExp(values);
      this.content = this.allContent.filter((item) => reg.test(item.title));
    },
    getBlogList() {
      this.$axios.get("/blog/alllist").then((res) => {
        let currentContent = res.data.data || [];
        this.allContent = currentContent;
        this.content = currentContent;
        let searchContent = currentContent.filter((item, index) => {
          return index <= 7;
        });
      });
    },
  },
};
</script>

<style></style>
